package com.xinqi.modules.course.demonstrate.service.impl;

import com.xinqi.modules.course.demonstrate.service.DemoCourseService;
import com.xinqi.modules.course.demonstrate.service.DemonstrateService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 示范课程
 *
 * @author dzy
 */
@Service("demonstrateService")
@RequiredArgsConstructor
public class DemonstrateServiceImpl implements DemonstrateService {

    /**
     * 课程
     */
    private final DemoCourseService demoCourseService;


    /**
     * 同步示范课程
     *
     * @param userId 示范课程用户ID
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean initAllCourse(Long userId) {
        demoCourseService.initCourseSql(userId);
        return true;
    }

}
